Msg("====Adverts module initialized...\n")

local advs = {
			  "Wellcome to the server_settings, have a nice day!",
			  "This	server_settings uses gSAM, made by SuperU."
			 }

function gSAM.AdvertLoop()
	if gSAM.Settings.Adverts then
		local advert = ""
		local f = file.Read("gSAM/Server/Adverts.txt")
		local t = {}
		if f then
			t = string.Explode("\n",f)
		else
			t = advs
		end
		advert = t[math.Rand(1,table.getn(t))]
		for k,v in pairs(player.GetAll()) do
			gSAM.HintPlayer(v,advert)
		end
		timer.Simple(gSAM.Settings.Adverts_Time,gSAM.AdvertLoop)
	end
end
hook.Add("InitPostEntity","gSAM.AdvertLoop",gSAM.AdvertLoop)
